Recurrence Relation Algorithm